package cn.com.twoke.easyproject.modules.system.domain;

import cn.com.twoke.easyproject.handler.mybatisplus.fill.BaseDOFillable;
import cn.com.twoke.easyproject.handler.mybatisplus.fill.VersionFillable;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * (SysUser)表实体类
 *
 * @author TwoKe
 * @since 2025-06-07 03:42:34
 */
@Data
@Schema(description = "SysUser")
@TableName("sys_user")
public class SysUser implements BaseDOFillable, VersionFillable {
    /**
     * 主键
     */
    @Schema(description = "主键")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;
    /**
     * 用户名
     */
    @Schema(description = "用户名")
    @TableField(value = "username")
    private String username;
    /**
     * 昵称
     */
    @Schema(description = "昵称")
    @TableField(value = "nickname")
    private String nickname;
    /**
     * 邮箱
     */
    @Schema(description = "邮箱")
    @TableField(value = "email")
    private String email;
    /**
     * 联系电话
     */
    @Schema(description = "联系电话")
    @TableField(value = "phone")
    private String phone;
    /**
     * 密码
     */
    @Schema(description = "密码")
    @TableField(value = "password")
    private String password;
    /**
     * 头像
     */
    @Schema(description = "头像")
    @TableField(value = "avatar")
    private String avatar;
    /**
     * 性别 （1 男 0女）
     */
    @Schema(description = "性别 （1 男 0女）")
    @TableField(value = "sex")
    private Integer sex;
    /**
     * 个人描述
     */
    @Schema(description = "个人描述")
    @TableField(value = "summary")
    private String summary;
    /**
     * 最后登录IP
     */
    @Schema(description = "最后登录IP")
    @TableField(value = "ip_address")
    private String ipAddress;
    /**
     * 最后登录IP归属地
     */
    @Schema(description = "最后登录IP归属地")
    @TableField(value = "ip_region")
    private String ipRegion;
    /**
     * 用户状态 （1 正常 0 禁用）
     */
    @Schema(description = "用户状态 （1 正常 0 禁用）")
    @TableField(value = "status")
    private Integer status;
    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    /**
     * 更新时间
     */
    @Schema(description = "更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
    @Schema(description = "最后登录时间")
    @TableField(value = "latest_login_time")
    private LocalDateTime latestLoginTime;
    @Schema(description = "最后登出时间")
    @TableField(value = "latest_logout_time")
    private LocalDateTime latestLogoutTime;
    /**
     * 创建人
     */
    @Schema(description = "创建人")
    @TableField(value = "create_user", fill = FieldFill.INSERT)
    private Long createUser;
    /**
     * 更新人
     */
    @Schema(description = "更新人")
    @TableField(value = "update_user", fill = FieldFill.INSERT_UPDATE)
    private Long updateUser;
    /**
     * 是否删除（1 删除 0 未删除 -1 不允许删除）
     */
    @Schema(description = "是否删除（1 删除 0 未删除 -1 不允许删除）")
    @TableField(value = "is_deleted", fill = FieldFill.INSERT)
    @TableLogic
    private Integer isDeleted;
    /**
     * 版本号
     */
    @Schema(description = "版本号")
    @TableField(value = "version", fill = FieldFill.INSERT)
    @Version
    private Long version;

}

